package com.ace3l.legal.backend.exceptions;

import java.text.MessageFormat;
import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Aug 18, 2008
 * Time: 8:28:03 PM
 * To change this template use File | Settings | File Templates.
 */
public enum Ace3LError implements Serializable {
    PROJECT_NOT_FOUND("Project {0} not found."),
    DATABASE_ERROR("Error accessing database for project {0}."),
    PROJECT_ALREADY_EXISTS("Project {0} already exists."),
    UNKNOWN_ERROR("Unknown error.");

    private final MessageFormat message;

    private Ace3LError(String msg) {
        this.message = new MessageFormat(msg);
    }

    Ace3LError() {
        this("Unknown Error.");
    }

    public final String renderMessage(Object[] params) {
        return message.format(params);
    }

}
